<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ page import="java.util.*"%>
<%@ page import="com.hilaver.dzmis.Constants"%>
<%@ page import="com.hilaver.dzmis.util.*"%>
<%@ page import="com.hilaver.dzmis.service.impl.*"%>
<%@ page import="com.hilaver.dzmis.product.*"%>
<%@ page import="com.hilaver.dzmis.basicinfo.*"%>
<%@ page import="com.hilaver.dzmis.codetable.*"%>
<%@ page import="com.hilaver.dzmis.basicinfo.BiMeasureSpecification"%>
<%
	Integer id = Integer.parseInt(request.getParameter("id"));
	BiMeasureSpecificationServiceImpl biMsService = new BiMeasureSpecificationServiceImpl();
	I18nServiceImpl i18n = new I18nServiceImpl();
	CtServiceImpl ctService = new CtServiceImpl();
	Locale locale = (Locale) request.getSession().getAttribute(
			Constants.SESSION_LOCALE);

	BiMeasureSpecification biMs = biMsService.getObj(id);
	Set<BiMeasureSpecificationItem> biMsItem = biMs
			.getBiMeasureSpecificationItems();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0"><meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /><meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<link rel="stylesheet" type="text/css" href="../../styles/dzbase.css"
	media="all" />
<script type="text/javascript">
	var getMeasureSpecificationItemName = function(ctStature){
		if(ctStature == '02'){
			return ['BIG 1X', 'BIG 2X', 'BIG 3X', 'BIG 4X', 'BIG 5X', 'BIG 6X', 'BIG 7X', 'BIG 8X'];
		}else if(ctStature == '03'){
			return ['TALL 1L', 'TALL 2L', 'TALL 3L', 'TALL 4L', 'TALL 5L', 'TALL 6L', 'TALL 7L', 'TALL 8L'];
		}else if(ctStature == '06'){
			return ['SIZE 0', 'SIZE 1', 'SIZE 2', 'SIZE 3', 'SIZE 4', 'SIZE 5', 'SIZE 6', 'SIZE 7'];
		}else{
			return ['SIZE XS', 'SIZE S', 'SIZE M', 'SIZE L', 'SIZE XL', 'SIZE XXL', 'SIZE XXXL', 'SIZE XXXXL'];
		}
	}
	var sizeNameArray = getMeasureSpecificationItemName('<%=biMs.getCtStature()%>');
</script>
<title><%=biMs.getPatronage()%></title>
</head>
<body>

<table cellspacing="0" id="the-table"
	style="width: 95%; margin-top: 5px;">
	<tr>
		<td style="background: #eeeeee; text-align: center;"><%=i18n.getShortMessage(locale,
							"ui.measurespecification.patronage")%></td>
		<td colspan="2"><%=biMs.getPatronage()%></td>
		<td style="background: #eeeeee; text-align: center;"><%=i18n.getShortMessage(locale,
							"ui.measurespecification.stature")%></td>
		<td colspan="2"><%=ctService.getDescription(CtCollarType.class.getName(),
							biMs.getCtCollarType(), locale)%></td>
		<td style="background: #eeeeee; text-align: center;"><%=i18n.getShortMessage(locale,
							"ui.measurespecification.stature")%></td>
		<td colspan="4"><%=ctService.getDescription(CtStature.class.getName(), biMs
							.getCtStature(), locale)%></td>
	</tr>
	<tr>
		<td colspan="5"><img height="200"
			src="../../_temp/<%=biMs.getRealPhoto1Name()==null?"noimage.gif":biMs.getRealPhoto1Name()  %>">
		</td>
		<td colspan="6"><img height="200"
			src="../../_temp/<%=biMs.getRealPhoto2Name()==null?"noimage.gif":biMs.getRealPhoto2Name() %>">
		</td>
	</tr>
	<tr>
		<td style="text-align: center; background: #eeeeee;">N°</td>
		<td style="text-align: center; background: #eeeeee;">
		DESIGNATIONS</td>
		<td style="text-align: center; background: #eeeeee;">
			<script type="text/javascript">document.write(sizeNameArray[0]);</script>
		</td>
		<td style="text-align: center; background: #eeeeee;"><script type="text/javascript">document.write(sizeNameArray[1]);</script></td>
		<td style="text-align: center; background: #eeeeee;"><script type="text/javascript">document.write(sizeNameArray[2]);</script></td>
		<td style="text-align: center; background: #eeeeee;"><script type="text/javascript">document.write(sizeNameArray[3]);</script></td>
		<td style="text-align: center; background: #eeeeee;"><script type="text/javascript">document.write(sizeNameArray[4]);</script></td>
		<td style="text-align: center; background: #eeeeee;"><script type="text/javascript">document.write(sizeNameArray[5]);</script></td>
		<td style="text-align: center; background: #eeeeee;"><script type="text/javascript">document.write(sizeNameArray[6]);</script></td>
		<td style="text-align: center; background: #eeeeee;"><script type="text/javascript">document.write(sizeNameArray[7]);</script></td>
		<td style="text-align: center; background: #eeeeee;">Tol</td>
	</tr>
	<%
		for (BiMeasureSpecificationItem pmsi : biMsItem) {
	%>
	<tr>
		<td style="text-align: center;"><%=pmsi.getNumber()%></td>
		<td style="text-align: center;"><%=ctService.getDescription(
										CtMsiDescription.class.getName(), pmsi
												.getCtMsiDescription(), locale)%></td>
		<td style="text-align: center;"><%=pmsi.getSize1() == null ? "" : pmsi.getSize1()%>
		</td>
		<td style="text-align: center;"><%=pmsi.getSize2() == null ? "" : pmsi.getSize2()%>
		</td>
		<td style="text-align: center;"><%=pmsi.getSize3() == null ? "" : pmsi.getSize3()%>
		</td>
		<td style="text-align: center;"><%=pmsi.getSize4() == null ? "" : pmsi.getSize4()%>
		</td>
		<td style="text-align: center;"><%=pmsi.getSize5() == null ? "" : pmsi.getSize5()%>
		</td>
		<td style="text-align: center;"><%=pmsi.getSize6() == null ? "" : pmsi.getSize6()%>
		</td>
		<td style="text-align: center;"><%=pmsi.getSize7() == null ? "" : pmsi.getSize7()%>
		</td>
		<td style="text-align: center;"><%=pmsi.getSize8() == null ? "" : pmsi.getSize8()%>
		</td>
		<td style="text-align: center;">+/-<%=pmsi.getTolerance() == null ? "" : pmsi
						.getTolerance()%></td>
	</tr>
	<%
		}
	%>
</table>
</body>
</html>